package yhao.infra.feature.dubbo;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author yoara
 * <p> Created on 2019/8/12 </p>
 */
@ConfigurationProperties(prefix = "yhao.dubbo")
public class YhaoDubboProperties {
    /**dubbo应用所在组织名**/
    private String applicationOrg;

    /**dubbo应用从属人**/
    private String applicationOwner;

    /**dubbo应用名**/
    private String applicationName;

    /**dubbo注册中心地址，默认使用nacos协议**/
    private String registryProtocol = "nacos";

    /**dubbo注册中心地址**/
    private String registryAddress;

    /**dubbo应用服务注册超时时间**/
    private int registryTimeout = 15000;

    /**dubbo应用服务端口**/
    private int protocolPort = 51000;

    /**dubbo客户端是否校验服务端存在，如果true，则服务端不存在直接报错**/
    private boolean consumerCheck = false;

    /**dubbo客户端连接超时时间**/
    private int consumerTimeout = 15000;

    public String getApplicationOrg() {
        return applicationOrg;
    }

    public void setApplicationOrg(String applicationOrg) {
        this.applicationOrg = applicationOrg;
    }

    public String getApplicationOwner() {
        return applicationOwner;
    }

    public void setApplicationOwner(String applicationOwner) {
        this.applicationOwner = applicationOwner;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public void setApplicationName(String applicationName) {
        this.applicationName = applicationName;
    }

    public String getRegistryAddress() {
        return registryAddress;
    }

    public void setRegistryAddress(String registryAddress) {
        this.registryAddress = registryAddress;
    }

    public int getProtocolPort() {
        return protocolPort;
    }

    public void setProtocolPort(int protocolPort) {
        this.protocolPort = protocolPort;
    }

    public int getRegistryTimeout() {
        return registryTimeout;
    }

    public void setRegistryTimeout(int registryTimeout) {
        this.registryTimeout = registryTimeout;
    }

    public boolean isConsumerCheck() {
        return consumerCheck;
    }

    public void setConsumerCheck(boolean consumerCheck) {
        this.consumerCheck = consumerCheck;
    }

    public int getConsumerTimeout() {
        return consumerTimeout;
    }

    public void setConsumerTimeout(int consumerTimeout) {
        this.consumerTimeout = consumerTimeout;
    }

    public String getRegistryProtocol() {
        return registryProtocol;
    }

    public YhaoDubboProperties setRegistryProtocol(String registryProtocol) {
        this.registryProtocol = registryProtocol;
        return this;
    }
}
